import { createApp } from 'vue'

import App from './App.vue'

//全局样式
import '@/styles/index.scss'

//element-plus 样式
import 'element-plus/dist/index.css'

//antd 样式
import 'ant-design-vue/dist/reset.css'

// 导入Unocss
import 'uno.css'

//全局svg
import { loadSvg } from '@/icons'

//全局插件 element antd
import { loadPlugins } from '@/plugins'

//路由
import router from './router'

//pinia
import pinia from './store'

import '@/utils/permission'

// 注入micro-app
import '@/micro-app/index'

import wujie from '@/wujie/index'

const app = createApp(App)

app.use(wujie)

// 加载插件
loadPlugins(app)

//加载全局 SVG
loadSvg(app)

// 第一种 挂载方法
app.config.globalProperties.$filters = {
  foo() {
    return 'foo'
  },
  formatTime(value) {
    return value
  }
}
// 第二种 挂载方法
const formatTime = value => {
  return value
}
app.provide('$formatTime', formatTime)

app.use(router)
app.use(pinia)
app.mount('#app')
